package top.huhuiyu.springboot3.p2301.service;

import top.huhuiyu.springboot3.p2301.base.R;

public interface MailService {
    String EMAIL_KEY = "email_code_%s";
    Integer EMAIL_CODE_EXPIRE = 5 * 60;
    String EMAIL_TEMPLATE = """
     <h1>
     你的邮箱验证码是：<span style='color:red;'>%s<span>，有效时间为5分钟，
     过期时间为：%s，过期前无法重新发送。
     </h1>
     """;

    void sendMail(String to, String subject, String content);

    R<String> sendMailCode(String email) throws Exception;

    R<String> validateMailCode(String email, String code);
}
